package com.ganee.agora.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.ganee.agora.R
import com.ganee.agora.manager.RecyclerViewHolder
import com.ganee.agora.model.MenuEntity

/**
 *    @author : EricCui
 *    date   : 2020-01-01 17:45
 *    desc   :
 */
class MenuAdapter (entityList: MutableList<MenuEntity>) : BaseQuickAdapter<MenuEntity,
        RecyclerViewHolder>(R.layout.item_recyclerview_menu,entityList){


    override fun convert(helper: RecyclerViewHolder, item: MenuEntity?) {

        if (item != null){
            val title = helper.getView<TextView>(R.id.item_title) as TextView
            val icon = helper.getView<ImageView>(R.id.item_icon) as ImageView
            title.text = item.title
            icon.setImageResource(item.icon)
        }
    }

}